package com.xiaozeng.search.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.xiaozeng.param.ProductSearchParam;
import com.xiaozeng.search.service.SearchService;
import com.xiaozeng.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xiaozeng
 * @Date: 2022 11
 * @Description:
 **/
@RestController
@RequestMapping("search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    /**
     *商品搜索接口
     */
    @PostMapping("product")
    public Result productList(@RequestBody ProductSearchParam productSearchParam) throws JsonProcessingException {
        return searchService.search(productSearchParam);
    }

}
